BITS 32
SECTION .text
GLOBAL inportb, outportb

; unsigned char inportb(unsigned short int port);
inportb:
	push ebp     ; save ebp
	mov ebp, esp 

;	xor edx, edx ; don't know if this is necessary.. :)
	
	mov dx, word [esp]
	in al, dx
	ret

; void outportb(unsigned short int port, unsigned char data);
outportb:
	xor eax, eax
	xor edx, edx
	
	mov dx, word [esp+4]	
	mov al, byte [esp+8]
	
	out dx, al
	ret
